﻿/*
 * Vector
 * 
 * initial implementation : 31.8.2007
 *
 * Copyright (c) Adam Sida, asida@centrum.cz.
 * All rights reserved.
 * 
 * for license see Petra.Gis.License.txt
 */
using System;
using System.Collections.Generic;
//using System.Text;
//using Petra.Gis.Geometry;

namespace Petra.Gis.Geometry.Support
{

  /// <summary>
  /// arc and text point specific readwrite vector 
  /// to store 3d orientation vector
  /// </summary>
  public unsafe class Vector : IVector
  {
    protected double dI, dJ, dK;


    
    public Vector()
    {

    }



    public Vector(double I, double J, double K)
    {
      dI = I;
      dJ = J;
      dK = K;
    }




    public Vector(ref byte[] vData, int BeginOfCoords)
    {
      fixed (byte* beginCoord = &vData[BeginOfCoords])
      {
        double* tmpPtr = (double*)beginCoord;
        dI = *tmpPtr++;
        dJ = *tmpPtr++;
        dK = *tmpPtr;
      }
    }



    public double I { get { return dI; } set { dI = value; } }
    public double J { get { return dJ; } set { dJ = value; } }
    public double K { get { return dK; } set { dK = value; } }


    public override string ToString()
    {
      return base.ToString() + "{" + dI.ToString() + ";" + dJ.ToString() + ";" + dK.ToString() + "}";
    }

  }
}
